Contents | Index | < Browse | Browse >
LETTERostreamULETTER
A stream class for output operations.
Overview
#include <iostream.h>
class ostream : virtual public ios {
public:
ostream(streambuf *b);
virtual ~ostream();
public:
int opfx();
void osfx();
ostream &operator <<(signed char c);
ostream &operator <<(unsigned char c);
ostream &operator <<(char);
ostream &operator <<(const unsigned char *s);
ostream &operator <<(const signed char *s);
ostream &operator <<(const char *);
ostream &operator <<(short i);
ostream &operator <<(unsigned short i);
ostream &operator <<(int i);
ostream &operator <<(unsigned int i);
ostream &operator <<(long);
ostream &operator <<(unsigned long);
ostream &operator <<(float);
ostream &operator <<(double);
ostream &operator <<(void *);
ostream &operator <<(streambuf *);
ostream &operator <<(ostream &(*f)(ostream &));
ostream &operator <<(ios &(*f)(ios &));
ostream &put(char c);
ostream &write(const signed char *s, int n);
ostream &write(const unsigned char *s, int n);
ostream &write(const char *s, int n);
ostream &flush();
streampos tellp();
ostream &seekp(streampos, ios::seek_dir = ios::beg);
ostream &seekp(streamoff, ios::seek_dir);
protected:
ostream();
};
Portability
AT&T Release 2 streams library
Description
The ostream class is the base class for formatted and unformatted output.
Constructors
ostream::ostream(streambuf *);
Initializes the output stream and binds the buffer.
Methods
int ostream::opfx();
This output prefix function performs all actions required for formatted
output and returns EOF if an error occured (which may also have already
occured before calling this method).
void ostream::osfx();
Output suffix function. Performs all actions required after an output.
ostream &ostream::operator <<(signed char c);
ostream &osream::operator <<(unsigned char c);
ostream &ostream::operator <<(char);
Outputs a single character.
ostream &ostream::operator <<(const unsigned char *s);
ostream &ostream::operator <<(const signed char *s);
ostream &ostream::operator <<(const char *);
Outputs a string.
ostream &ostream::operator <<(short i);
ostream &ostream::operator <<(unsigned short i);
ostream &ostream::operator <<(int i);
ostream &ostream::operator <<(unsigned int i);
ostream &ostream::operator <<(long);
ostream &ostream::operator <<(unsigned long);
Outputs a number with or without sign prefix, depending on its type.
ostream &ostream::operator <<(float);
ostream &ostream::operator <<(double);
Outputs a floating-point number.
ostream &ostream::operator <<(void *);
Outputs a pointer as a hexadecimal integer.
ostream &ostream::operator <<(ostream &(*f)(ostream &));
ostream &ostream::operator <<(ios &(*f)(ios &));
Support for simple manipulators. The function specified will be called with
the ostream object as argument.
ostream &ostream::put(char c);
Unformatted output of a character.
ostream &ostream::write(const signed char *s, int n);
ostream &ostream::write(const unsigned char *s, int n);
ostream &ostream::write(const char *s, int n);
Unformatted output of n characters, the zero byte will be ignored.
ostream &ostream::flush();
Flushes the output stream. All characters in the buffer will be physically
written. This is the only function to cause the physical output (besides if
the buffer is full) - the "\n" char does not have this effect, regardless
if you use cout or any other console file.
streampos ostream::tellp();
Returns the current position of the stream's write pointer which must not
necessarily be the stream's physical position (eg. in a file) due to the
usage of the stream buffer.
ostream &ostream::seekp(streampos, ios::seek_dir = ios::beg);
Sets the stream's write pointer to the specified offset based on the
relative seek position. See streambuf::seekoff() and streambuf::seekpos()
for details.
ostream &seekp(streamoff, ios::seek_dir);
Sets the stream's write pointer to the specified position obtained from a
call to ostream::tellp().
See also
ios , iostream , ofstream , istream